package com.testsoap;
import java.util.Hashtable;

import org.ksoap2.serialization.KvmSerializable;
import org.ksoap2.serialization.PropertyInfo;


public class Episode implements KvmSerializable
{
	public int id;
	public int temporada;
	public int capitulo;
	public String fecha_emision;
	public String overview;
	public String nombre;
	public String serie;
	

	public Episode(){
	
	}
	
	public Episode(int id, int temporada, int capitulo, String fecha_emision, String overview, String nombre, String serie) {
		this.id=id;
		this.temporada=temporada;
		this.capitulo=capitulo;
		this.fecha_emision=fecha_emision;
		this.overview=overview;
		this.nombre=nombre;	
		this.serie=serie;
	}
	
	public Object getProperty(int arg0) {
        
        switch(arg0)
        {
        case 0:
            return id;
        case 1:
            return temporada;
        case 2:
            return capitulo;
        case 3:
        	return fecha_emision;
        case 4:
        	return overview;
        case 5:
        	return nombre;
        case 6:
        	return serie;
        }
        return null;
    }
	
	public int getPropertyCount() {
        return 7;
    }
	
    public void getPropertyInfo(int index, Hashtable arg1, PropertyInfo info) {
        switch(index)
        {
        case 0:
            info.type = PropertyInfo.INTEGER_CLASS;
            info.name = "id";
            break;
        case 1:
            info.type = PropertyInfo.INTEGER_CLASS;
            info.name = "temporada";
            break;
        case 2:
            info.type = PropertyInfo.INTEGER_CLASS;
            info.name = "capitulo";
            break;
        case 3:
            info.type = PropertyInfo.STRING_CLASS;
            info.name = "fecha_emision";
            break; 
        case 4:
            info.type = PropertyInfo.STRING_CLASS;
            info.name = "overview";
            break;     
        case 5:
            info.type = PropertyInfo.STRING_CLASS;
            info.name = "nombre";
            break;   
        case 6:
            info.type = PropertyInfo.STRING_CLASS;
            info.name = "serie";
            break;       
        default:break;
        }
    }

    public void setProperty(int index, Object value) {
        switch(index)
        {
        case 0:
            id = Integer.parseInt(value.toString());
            break;
        case 1:
            temporada = Integer.parseInt(value.toString());
            break;
        case 2:
            capitulo = Integer.parseInt(value.toString());
            break;
        case 3:
        	fecha_emision = value.toString();
        case 4:
        	overview = value.toString();
        case 5:
        	nombre = value.toString();
        case 6:
        	serie = value.toString();
        default:
            break;
        }
    }



}
